package dbManager;

import java.util.ArrayList;

/**
 *	Saving for tag the paths of the files the tag exists
 */
public class TagFiles 
{
	String tag;
	ArrayList<String> paths;
	
	
	
	public TagFiles(String tag)
	{
		this.tag = tag;
		this.paths = new ArrayList<String>();
	}

	/**
	 *  This function add the new path if this path wasn't added before
	 * @param path is a path of file which have this tag
	 */
	void addPath(String path)
	{
		//this for loop run over the list paths and check if 'path' was added before
		for (int i = 0; i < paths.size(); i++)
		{
			if (paths.get(i).equals(path))
				return;
		}
		//the case 'path' wasn't added before
		paths.add(path);
	}

	/*get and set functions*/

	public String getTag() 
	{
		return tag;
	}

	public void setTag(String tag) 
	{
		this.tag = tag;
	}

	public ArrayList<String> getPaths() 
	{
		return paths;
	}

	public void setPaths(ArrayList<String> paths) 
	{
		this.paths = paths;
	}	
}
